<template>
    <div class="audit-task-view">

      <el-form ref="elForm" :model="datas" size="small" label-width="110px">
        <el-row>
          <el-col :span="8" v-if="datas.task_no">
            <el-form-item label="任务编号：">
              <div>{{datas.task_no}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="任务名称：">
              <div>{{datas.task_name}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="父任务：" v-if="datas.level != 1">
              <div>{{datas.parent_name}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="前置任务：" v-if="datas.level != 1">
              <div>{{datas.foreground_task_name?datas.foreground_task_name:'无'}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="工期（天）：">
              <div>{{datas.duration}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="计划开始时间：">
              <div>{{datas.start_date ? dateFormat1('yyyy-mm-dd',datas.start_date) : ""}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="计划结束时间：">
              <div>{{datas.end_date ? dateFormat1('yyyy-mm-dd',datas.end_date) : ""}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="任务负责人：">
              <div v-if="datas.person_in_charge">{{datas.person_in_charge.member_name}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="任务参与人：">
              <div v-if="datas.task_member">
                <span v-for="(item,index) in datas.task_member">{{item.member_name}}{{index != datas.task_member.length-1 ? "," : ''}}</span>
              </div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="阶段性评审：">
              <div>{{datas.periodical_review?"是":"否"}}</div>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="强制验收：">
              <div>{{datas.mandatory_check?"是":"否"}}</div>
            </el-form-item>
          </el-col>

        </el-row>

      </el-form>

      <el-table
        size="medium"
        :data="datas.files"
        align="center"
        border
        style="width: 100%">
        <el-table-column
          align="center"
          prop="file_name"
          label="文档名称">
        </el-table-column>
        <el-table-column
          align="center"
          prop="type_name"
          label="文档类型">
        </el-table-column>
        <el-table-column
          align="center"
          label="申报所需文件">
          <template slot-scope="scope">
            <span>{{scope.row.need?'是':'否'}}</span>
          </template>
        </el-table-column>
      </el-table>

    </div>
</template>

<script>
    export default {
        name: "taskView",
        props:{
            datas:{
                type:Object,
                default:function () {
                    return{}
                }
            }
        }
    }
</script>

<style scoped>

</style>
